package com.zekdot.logserver.mq;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Create by zekdot on 20-3-19.
 */
@Configuration
public class LogRabbitConfig {
    @Bean
    public Queue LogQueue(){
        return new Queue("LogQueue",true);
    }

    @Bean
    DirectExchange LogExchange(){
        return new DirectExchange("LogExchange");
    }

    @Bean
    Binding bindingDirect(){
        return BindingBuilder.bind(LogQueue()).to(LogExchange()).with("LogRouting");
    }
}
